//---------------------------------------------------------------------
// <copyright file="EdmParameterReferenceExpression.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

using Microsoft.Data.Edm.Expressions;

namespace Microsoft.Data.Edm.Library.Expressions
{
    /// <summary>
    /// Represents an EDM parameter reference expression.
    /// </summary>
    public class EdmParameterReferenceExpression : EdmElement, IEdmParameterReferenceExpression
    {
        private readonly IEdmFunctionParameter referencedParameter;

        /// <summary>
        /// Initializes a new instance of the <see cref="EdmParameterReferenceExpression"/> class.
        /// </summary>
        /// <param name="referencedParameter">Referenced parameter</param>
        public EdmParameterReferenceExpression(IEdmFunctionParameter referencedParameter)
        {
            EdmUtil.CheckArgumentNull(referencedParameter, "referencedParameter");
            this.referencedParameter = referencedParameter;
        }

        /// <summary>
        /// Gets the referenced parameter.
        /// </summary>
        public IEdmFunctionParameter ReferencedParameter
        {
            get { return this.referencedParameter; }
        }

        /// <summary>
        /// Gets the kind of this expression.
        /// </summary>
        public EdmExpressionKind ExpressionKind
        {
            get { return EdmExpressionKind.ParameterReference; }
        }
    }
}
